//
// C++ Interface: button
//
// Description: 
//
//
// Author: Os3 s.r.l. <xgui@os3.it>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//

namespace xgui
{   
    %feature("docstring","derives from :class:`xgui.WidgetClass` ") ButtonClass;
	struct ButtonClass : public xgui::WidgetClass
	{
		ButtonClass();
		std::string const &className();
		bool isInstanceable();

		xgui::Object * create(xgui::Object * parent, xgui::StringMap &properties);
	};

    %feature("docstring","derives from :class:`xgui.Widget` \n\n**DESCRIPTION** \n\nThe Button is a widget that the user can click to provide input to the application.This class cannot be directly instantiated, but must be created using the\n:meth:`xgui.Master.CreateButton()` function.\n\n**PROPERTIES**\n\n * **image-path** *(RW):* \n   sets or retrieves the path of the file containing the image displayed on the button;\n   if set to empty string no image is displayed\n\n * **text** *(RW):* \n   sets or retrieves the text displayed on the button\n\n * **pressed** *(RW):* \n   if set to \"1\" the button is in a pressed state (for toggle or radio buttons), if set to *\"0\"* the button is released\n\n * **alignment** *(RW):* \n   sets or retrieves the alignment of the button text; it can be one of the following values: *\"top-left\, \"top\", \"top-right\", \"left\", \"center\", \"right\", \"bottom-left\", \"bottom\", \"bottom-right\"* (default: \"center\")\n\n**EVENTS**\n\n * **onclick** *(linked to* :class:`xgui.Callback` *)*: \n   fired when the button is clicked\n\n**METHODS**\n\n") Button;
	class Button : public xgui::Widget
	{
		protected:
			Button(xgui::Container * parent, std::string const &text, xgui::Image * image, bool toggle_button);
			virtual ~Button();

		public:
		    %feature("docstring","sets the icon to be displayed on the button\n\n*C++*::\n\n int setIcon ( Image * img );\n\n") setIcon;
			void setIcon ( Image * img );
			%feature("docstring","returns the image displayed on the button\n\n*C++*::\n\n xgui::Image * getIcon();\n") getIcon;
			xgui::Image * getIcon();
	};
}

%extend xgui::Button {
	%pythoncode {
		def __del__(self):
			if self.valid: self.delPyOwner(self)
	}
}
